package _9994FuWuDingWeiQo;

import _9994FuWuDingWeiQo.impl.ServiceOneImpl;
import _9994FuWuDingWeiQo.impl.ServiceTwoImpl;

/**
 * @InitialContext:
 * @author: ZBoHang
 * @time: 2021/9/18 11:53
 */
public class InitialContext {
    public Object lookUp(String jndiName) {
        if ("ServiceOne".equalsIgnoreCase(jndiName)) {
            System.out.println("找到并创建ServiceOne");
            return new ServiceOneImpl();
        } else if ("ServiceTwo".equalsIgnoreCase(jndiName)) {
            System.out.println("找到并创建ServiceTow");
            return new ServiceTwoImpl();
        }
        return null;
    }
}
